package com.shu.qq.common

import android.content.Context
import android.util.Log
import cn.hutool.core.util.StrUtil
import com.shu.qq.utils.SharedPreferenceHelper
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
import javax.inject.Singleton

const val TAG = "shu-check"
@Singleton
class Authentication @Inject constructor(@ApplicationContext context: Context) {
    companion object{
        private const val AUTHENTICATION_FILE = "user_authentication"
        private const val AUTHENTICATION_KEY = "authentication_key"
    }
    var sharedPreferenceHelper = SharedPreferenceHelper(context,AUTHENTICATION_FILE)
    var token:String = sharedPreferenceHelper.get(AUTHENTICATION_KEY,"") as String //token
        set(value) {
            field = value
            sharedPreferenceHelper.put(AUTHENTICATION_KEY,value)
            Log.d(TAG, "设置得token为: ${value} ")
        }
        get() {
            Log.d(TAG, "获取到得token为: ${field} ")
            return field
        }






}